package demo1;


import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class App {
    private static final Logger logger = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) {
        logger.info("This is an info message.");
        logger.debug("This is a debug message.");
        logger.error("This is an error message.");

        // 使用 Lombok 的 @Slf4j（需要一个实例方法）
        Slf4jExample example = new Slf4jExample();
        example.logWithLombok();
    }
}

@Slf4j
class Slf4jExample {
    public void logWithLombok() {
        log.debug("Debug message from Lombok");
        log.info("Info message from Lombok");
        log.warn("Warn message from Lombok");
        log.error("Error message from Lombok");
    }
}